program q1096;
var
    i, current, ans, flg, t: integer;
begin
    assign(input, '');
    assign(output, '');
    reset(input);
    rewrite(output);

    current := 0;
    ans := 0;
    flg := 1;
    for i:=1 to 12 do begin
        readln(t);

        current := 300 - t + current;
        if (current < 0) then begin
            writeln(-i);
            flg := 0;
            break;
        end
        else begin
            ans := ans + (current div 100) * 100;
            current := current mod 100;
        end;
    end;

    if (flg = 1) then writeln(trunc(ans * 1.2) + current);

    close(input);
    close(output);
end.
